import Vue from 'vue'
import Vuex from 'vuex'
import Cinemalist from '../store/modules/Cinemalist'
import City from '../store/modules/City'
import Showhidebar from '../store/modules/Showhidebar'
import ceratedPerisistedState from 'vuex-persistedstate'
Vue.use(Vuex)

export default new Vuex.Store({
    // plugins: [ceratedPerisistedState()],
    state: {
        // Cityid: '361000',
        // Cityname: '抚州',
        // ishowtoplogo: true,
        // ishowbuttom: true,
        // ishowtopbar: true,
        // cinemalist: []

    },
    mutations: {
        // changecityname (state, name) {
        //   state.Cityname = name
        // },
        // changecityid (state, id) {
        //   state.Cityid = id
        // },
        // toplogoshow (state) {
        //   state.ishowtoplogo = true
        // },
        // topbarshow (state) {
        //   state.ishowtopbar = true
        // },

        // buttomshow (state) {
        //   state.ishowbuttom = true
        // },
        // toplogohide (state) {
        //   state.ishowtoplogo = false
        // },
        // topbarhide (state) {
        //   state.ishowtopbar = false
        // },
        // buttomhide (state) {
        //   state.ishowbuttom = false
        // },
        // setcinema (state, newcinemalist) {
        //   state.cinemalist = newcinemalist
        // },
        // clearcinema (state) {
        //   state.cinemalist = []
        // }

    },
    actions: {
        // getcinemalist (store, cityid) {
        //   http({
        //     url: `/gateway?cityId=${cityid}&ticketFlag=1&k=1855704`,
        //     headers: {
        //       'X-Host': 'mall.film-ticket.cinema.list'
        //     }
        //   }).then(res => {
        //     store.commit('setcinema', res.data.data.cinemas)
        //   })
        // }
    },
    modules: {
        Cinemalist,
        Showhidebar,
        City
    }
})